<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<span>获取键盘按键信息</span>
		<p></p>
		<script type="text/javascript">
			window.onload = function (){
				var oP = document.getElementsByTagName("p")[0];
				document.onkeydown = function(event){
					var event = event || window.event;
					oP.innerHTML = event.keyCode;
					return false;
				}
			}
		</script>
	</body>
</html>
